/**
 * 本地数据存储或读取
 */
function localItem(key, value) {
    if (arguments.length === 1) {
        return localStorage.getItem(key);
    } else {
        return localStorage.setItem(key, value);
    }
}

/**
 * 删除本地数据
 */
function removeLocalItem(key) {
    if (key) {
        return localStorage.removeItem(key);
    }
    return localStorage.removeItem;
}

module.exports = {
    localItem, removeLocalItem
};